AspectC++ – An AOP Extension for C++
نویسندگان
چکیده
More and more software developers get in touch with aspect-oriented programming (AOP). By providing means to modularize the implementation of crosscutting concerns, it stands for more reusability, less coupling between modules, and better separation of concerns in general. Today, solid tool support for AOP is available, for instance, by JBoss (JBoss AOP), BEA (AspectWerkz), and IBM (AspectJ and the AJDT for Eclipse). However, all these products are based on the Java language. For C and C++ developers none of the key players offers AOP support, yet. This article introduces AspectC++, which is an aspectoriented language extension for C++. A compiler for AspectC++, which transforms the source code into ordinary C++ code, is developed as an open source project. The AspectC++ project began with a research prototype in 2001 that has gained maturity over the years. Today, the AspectC++ language and weaver has been successfully applied in a number of real-world projects in industry and academia and IDE integration into Eclipse and Microsoft VisualStudio.NET makes the first steps a child’s play. Our AspectC++ introduction will start with an example that can be considered the “Hello World” of AOP. It will illustrate the basic language elements like aspects, pointcuts, and advice, which some readers might already know from the AspectJ language. We will then quickly step beyond these AspectJ-like language elements by looking into an AspectC++ version of the well-known observer pattern and into “Generic Advice”. This unique AspectC++ feature combines the power of aspects with generic and generative programming in C++.
منابع مشابه
The design and implementation of AspectC + + q
Aspect-Oriented Programming (AOP) is a programming paradigm that supports the modular implementation of crosscutting concerns. Thereby, AOP improves the maintainability, reusability, and configurability of software in general. Although already popular in the Java domain, AOP is still not commonly used in conjunction with C/C++. For a broad adoption of AOP by the software industry, it is crucial...
متن کاملAdvances in AOP with AspectC++1
Often declared dead or at least dying, C/C++ is still the lingua franca of many application domains. Aspect-Oriented Programming (AOP) is a programming paradigm that supports the modular implementation of crosscutting concerns. Thereby, AOP improves the maintainability, reusability, and configurability of software in general. Although already popular in the Java domain, AOP is still not commonl...
متن کاملAspectC++: Language Proposal and Prototype Implementation
ABSTRACT The su ess of aspe t-oriented programming (AOP) raises and falls with user-friendly tool support. With Aspe tJ1 the rst omplete and powerful language extension for AOP has been reated. With this paper we intend to extend the Aspe tJ approa h to C/C++. We will present and dis uss a proposal for a set of language extensions we all Aspe tC++ to fa ilitate aspe t-oriented programming with ...
متن کاملGeneric Advice: On the Combination of AOP with Generative Programming in AspectC++
Besides object-orientation, generic types or templates and aspectoriented programming (AOP) gain increasing popularity as they provide additional dimensions of decomposition. Most modern programming languages like Ada, Eiffel, and C++ already have built-in support for templates. For Java and C# similar extensions will be available in the near future. Even though promising, the combination of as...
متن کاملAn Aspect-Oriented Implementation of Interrupt Synchronization in the PURE Operating System Family∗
Some concerns in the design of operating systems are hard to modularize in the implementation and thus difficult to maintain. One of these “crosscutting concerns” is the interrupt synchronization strategy. Changing that strategy is typically expensive and risky. Aspect-oriented programming (AOP) is a promising approach to overcome these problems, but most aspect-oriented programming languages a...
متن کامل